package org.example.testdemo.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("project")
public class Project {
    @TableId("p_id")
    @NotNull(message = "请输入项目代码")
    private String pId;//项目代码
    @NotNull(message = "请输入项目名称")
    @TableField("p_name")
    private String pName;//项目名称
    @TableField("userId")
    @NotNull(message = "请选择项目负责人")
    private String userId;//项目负责人
    @TableField("b_Code")
    @NotNull(message = "请选择归属部门")
    private String bCode;//部门编号
    @TableField("level")
    private Integer level;//级次
    @TableField("details")
    private Integer details=1;//明细
    @TableField("balanceDirection")
    @NotNull(message = "请选择余额方向")
    private String balanceDirection;//余额方向
    @TableField("initialAmount")
    @NotNull(message = "请输入初期金额")
    private BigDecimal initialAmount;//初期金额
    @TableField("Income")
    private BigDecimal income= BigDecimal.valueOf(0.0);//项目收入
    @TableField("expenses")
    private BigDecimal expenses= BigDecimal.valueOf(0.0);//项目支出
    @TableField("freezeAmount")
    private BigDecimal freezeAmount= BigDecimal.valueOf(0.0);//冻结金额
    @TableField("limitPayment")
    @NotNull(message = "请输入限制金额")
    private BigDecimal limitPayment;//超支限额
    @TableField("balance")
    private BigDecimal balance;//当前余额
    @TableField("state")
    private Integer state=1;//项目状态
    @TableField("creationTime")
    private LocalDateTime creationTime=LocalDateTime.now();//创建时间
    @TableField("changeTime")
    private LocalDateTime changeTime=LocalDateTime.now();//修改时间
}
